﻿@using Orchard.ContentManagement;

@{
    var userCanRegister = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
    var enableLostPassword = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;
}

<h1 class="page-title">@Html.TitleForPage((string)Model.Title)</h1>
<p>
    @T("Please enter your username and password.") 
    @if(userCanRegister) { @Html.ActionLink(T("Register").Text, "Register") @T(" if you don't have an account.") }
    @if(enableLostPassword) { @Html.ActionLink(T("Lost your Password?").Text, "RequestLostPassword") }
</p>
@Html.ValidationSummary(T("Login was unsuccessful. Please correct the errors and try again.").ToString())

@using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new { ReturnUrl = Request.QueryString["ReturnUrl"] }))) {
<fieldset class="login-form group">
    <legend>@T("Account Information")</legend>
    <ol>
    <li>
        <label for="username-email">@T("Username")</label>
        @Html.TextBox("userNameOrEmail", "", new { id = "username-email", autofocus = "autofocus" })
        @Html.ValidationMessage("userNameOrEmail")
    </li>
    <li>
        <label for="password">@T("Password")</label>
        @Html.Password("password")
        @Html.ValidationMessage("password")
    </li>
    <button class="primaryAction" type="submit">@T("Sign In")</button>
    </ol>
</fieldset>
}